import request from '@/utils/request'
import requestII from '@/utils/requestII'
import requestIII from '@/utils/requestIII'

import * as url from 'url'
// 社区移动端登录接口
// 根据code获取用户信息
export function getUserInfoByCode (code) {
  return request({
    url: `/CommunityPension/api/getUserInfoByCode/${code}`,
    method: 'get'
  })
}
// 根据用户ID获取用户信息
export function getUserInfoById (userId) {
  return request({
    url: `/CommunityPension/api/getUserInfoById/${userId}`,
    method: 'get'
  })
}
// 根据openId绑定用户电话
export function saveOpenIdByUserTel (data) {
  return request({
    url: '/CommunityPension/api/saveOpenIdByUserTel',
    method: 'post',
    data
  })
}
// 用户登陆
// 根据openid绑定用户电话
// 七牛上传token
export function getPensionToken () {
  return request({
    url: '/WeChatApi/Qiniu/getPensionToken',
    method: 'get'
  })
}





// 获取工单列表
export function getTicksList(pageInfo){
    const {page,size} = pageInfo
    return requestII.get(`/WorkOrderHome/WorkOrderHomeTable?page=${page}&size=${size}`)
}
// 获取工单头部列表
export function getWorkOrderHomeTop(){
    return requestII.get('/WorkOrderHome/WorkOrderHomeTop')
}

// 处理数据
export function getWorkOrderHomeOrInfo(id){
    return requestII.get(`/WorkOrderHome/SelectWorkOrderHomeOrInfo?workOrderHomeId=${id}`)
}

// 新增 
export function addWorkOrderHome(data){
    return requestII({
        url:'/WorkOrderHome/InsertWorkOrderHome',
        method:'post',
        data:data
    })
}
// 操作处理
export function clWorkOrderInfo(data){
    return requestII({
        url:'/WorkOrderHome/InsertWorkOrderInfo',
        method:'post',
        data:data
    })
    // xuyao info的id
}

// 删除
export function deleteWorkOrderHomeOrInfo(id){
    return requestII.get(`/WorkOrderHome/DeleteWorkOrderHomeOrInfo?workOrderHomeId=${id}`)
}
// DeleteWorkOrderHomeOrInfo
// String workOrderHomeId



export function getUserShebeiList(id){
  // return requestIII.get(`/Device/DeviceInFo?userid=${id}`)
  return requestIII.get(`/Device/DeviceInFo`)

}